We want to use it for the rubberband later.
gtk_rb_tree_node_mark_dirty (cell);
}
-static void
-gtk_grid_view_size_allocate_child (GtkGridView *self,
- GtkWidget *child,
- int x,
- int y,
- int width,
- int height)
-{
- GtkAllocation child_allocation;
-
- if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
- {
- child_allocation.x = x;
- child_allocation.y = y;
- child_allocation.width = width;
- child_allocation.height = height;
- }
- else if (_gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_LTR)
- {
- child_allocation.x = y;
- child_allocation.y = x;
- child_allocation.width = height;
- child_allocation.height = width;
- }
- else
- {
- int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
-
- child_allocation.x = mirror_point - y - height;
- child_allocation.y = x;
- child_allocation.width = height;
- child_allocation.height = width;
- }
-
- gtk_widget_size_allocate (child, &child_allocation, -1);
-}
-
static int
gtk_grid_view_compute_total_height (GtkGridView *self)
{
{
row_height += cell->size;
- gtk_grid_view_size_allocate_child (self,
+ gtk_list_base_size_allocate_child (GTK_LIST_BASE (self),
cell->parent.widget,
x + ceil (self->column_width * i),
y,
remove_autoscroll (self);
}
+/**
+ * gtk_list_base_size_allocate_child:
+ * @self: The listbase
+ * @child:
+ * @x: top left coordinate in the across direction
+ * @y: top right coordinate in the along direction
+ * @width: size in the across direction
+ * @height: size in the along direction
+ *
+ * Allocates a child widget in the list coordinate system,
+ * but with the coordinates already offset by the scroll
+ * offset.
+ **/
+void
+gtk_list_base_size_allocate_child (GtkListBase *self,
+ GtkWidget *child,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ GtkAllocation child_allocation;
+
+ if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
+ {
+ child_allocation.x = x;
+ child_allocation.y = y;
+ child_allocation.width = width;
+ child_allocation.height = height;
+ }
+ else if (_gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_LTR)
+ {
+ child_allocation.x = y;
+ child_allocation.y = x;
+ child_allocation.width = height;
+ child_allocation.height = width;
+ }
+ else
+ {
+ int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
+
+ child_allocation.x = mirror_point - y - height;
+ child_allocation.y = x;
+ child_allocation.width = height;
+ child_allocation.height = width;
+ }
+
+ gtk_widget_size_allocate (child, &child_allocation, -1);
+}
+
void
gtk_list_base_allocate_rubberband (GtkListBase *self)
{
gboolean select,
gboolean modify,
gboolean extend);
+
void gtk_list_base_set_enable_rubberband (GtkListBase *self,
gboolean enable);
gboolean gtk_list_base_get_enable_rubberband (GtkListBase *self);
-
void gtk_list_base_allocate_rubberband (GtkListBase *self);
+void gtk_list_base_size_allocate_child (GtkListBase *self,
+ GtkWidget *child,
+ int x,
+ int y,
+ int width,
+ int height);
+
#endif /* __GTK_LIST_BASE_PRIVATE_H__ */
gtk_list_view_measure_across (widget, orientation, for_size, minimum, natural);
}
-static void
-gtk_list_view_size_allocate_child (GtkListView *self,
- GtkWidget *child,
- int x,
- int y,
- int width,
- int height)
-{
- GtkAllocation child_allocation;
-
- if (gtk_list_base_get_orientation (GTK_LIST_BASE (self)) == GTK_ORIENTATION_VERTICAL)
- {
- child_allocation.x = x;
- child_allocation.y = y;
- child_allocation.width = width;
- child_allocation.height = height;
- }
- else if (_gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_LTR)
- {
- child_allocation.x = y;
- child_allocation.y = x;
- child_allocation.width = height;
- child_allocation.height = width;
- }
- else
- {
- int mirror_point = gtk_widget_get_width (GTK_WIDGET (self));
-
- child_allocation.x = mirror_point - y - height;
- child_allocation.y = x;
- child_allocation.width = height;
- child_allocation.height = width;
- }
-
- gtk_widget_size_allocate (child, &child_allocation, -1);
-}
-
static void
gtk_list_view_size_allocate (GtkWidget *widget,
int width,
{
if (row->parent.widget)
{
- gtk_list_view_size_allocate_child (self,
+ gtk_list_base_size_allocate_child (GTK_LIST_BASE (self),
row->parent.widget,
x,
y,